#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

using namespace std;

int main()
{
	string s1, s2;
	while (cin >> s1 >> s2)
	{
		int n = 0;
		for (int i = 1; s1[i]; i++)
		{
			if (s1[n] < s1[i])
			{
				n = i;
			}
		}
		cout << s1.substr(0, n + 1) + s2 + s1.substr(n + 1) << endl;
	}
	return 0;
}